package com.chinaunicom.circularref;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author liry
 * @version 1.0
 * @date Created on 2021/11/25 15:38
 * Description:
 */

@Data
public class TestA {

	private TestB testB;

	// 构造器注入
	@Autowired
	public TestA(TestB testB){
		this.testB = testB;
	}

	public void a(){
		this.testB.b();
	}

	// setter 注入器注入
	public void setTestA(TestB testB) {
		this.testB = testB;
	}

	public TestB getTestA() {
		return this.testB;
	}

	public TestA(){}

	public void showMsg(){
		System.out.println("测试循环引用...");
	}

}
